package com.library.common.utils.z3950;

import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Package: com.library.common.utils.z3950
 * @ClassName: PriceUtils
 * @Author: Yin
 * @Date: 18:17
 * @Description: 机读目录记录数据 价格编译
 */
public class PriceUtils {

    private static final String regex  = "\\d+(\\.\\d+)?";

    /**
     * 人民币换算
     */
    public static String toCNY(String str) {
        Pattern compile = Pattern.compile(regex);
        Matcher matcher = compile.matcher(str);
        if(matcher.find()) {
            String group = matcher.group();
            return group;
        }
        return "0";
    }

    public static void main(String[] args) {
        toCNY("CNY85.99");
    }

}
